<html>
    <head>
     </head>
 <body>
<div class="users index">
    <h2>Personal Management Information System (PMIS)</h2>
	<h3><?php __('Gradation wise Report');?>&nbsp;<a href="javascript:window.print()">Click to Print</a></h3>
	<table cellpadding="1" cellspacing="0" border="1px" width="100%">
	<tr>

			<th width="3%">SL</th>
			<th width="7%">Photo</th>
			<th width="15%">Name</th>
			<th width="5%">Gradation</th>
			<th width="8%">Date of Birth</th>
                        <th width="8%">Date of First Joining</th>
                        <th width="15%">Present Post</th>
                         <th width="8%">Posting Place</th>
                         <th width="8%">Date of Joining</th>
			<th>Remarks</th>
	</tr>
	<?php
	$i = 0;
	foreach ($users as $user):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
   
                $fstjdate= $this->requestAction('/uinformations/ascdate/'.$user['User']['id']);
    $curjdate= $this->requestAction('/uinformations/dscdate/'.$user['User']['id']);
  //echo'<pre>';
   // print_r($fstjdate);
   /*  echo '------------------------';
    echo '<br>';
    print_r($curjdate);*/
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i;//echo $user['User']['id']; ?>&nbsp;</td>
	<td align="center">
                <?php
                if (strlen($user['Uinformation']['photo']) > 0) {
                ?>
    <?php echo $html->image("/img/photo/" . $user['Uinformation']['photo'],
            array('width' => '50px','height'=>'50px', 'border' => '2px')); ?>
           <?php
            }else{
                ?>
    <?php echo $html->image("/img/photo/NoPhotoAvailable.jpg",
            array('width' => '50px','height'=>'50px', 'border' => '2px')); ?>
           <?php
            }
            ?>
        </td>
		
		<td><?php echo $user['User']['fullname']; ?>&nbsp;</td>
		<td>
                 <?php echo $user['Uinformation']['gradationnumber']; ?>&nbsp;
                </td>
		<td>
                 <?php 
                 //echo $user['Uinformation']['datebirth'];
                echo date('d-M-Y', strtotime($user['Uinformation']['datebirth']));
                 ?>&nbsp;
                </td>
                <td><?php 
                if(!empty($fstjdate))
                echo date('d-M-Y', strtotime($fstjdate[0]['Precord']['datefrom']));
                ?>&nbsp;</td>
                <td><?php
                  if(!empty($curjdate))
                echo $curjdate[0]['Precord']['post'];

                  ?>&nbsp;</td>
		<td ><?php
                  if(!empty($curjdate))
                echo $curjdate[0]['Precord']['placeofposting'];

                  ?>&nbsp;</td>
                <td ><?php
                  if(!empty($curjdate))
                echo date('d-M-Y', strtotime($curjdate[0]['Precord']['datefrom']));
                  ?>&nbsp;</td>
                <td >&nbsp;</td>
	</tr>
<?php endforeach; ?>
	</table>
	
</div>
     <style >
div.index,
div.view {
	float:right;
	width:94%;
	border-left:0px solid #666;
	padding:10px 2%;

}
#otb, th, td
{
border: 1px solid black;
 border-collapse: collapse;
  font-family: verdana,helvetica,arial,sans-serif;
  font-size: 11px;
}
h3 {
	color: #EE3322;

}
</style>
</body>
</html>